home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.5 KB  |  66 lines

  1. /* Copyright (C) 1992, 1993, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsutil.h,v 1.3 2000/09/19 19:00:33 lpd Exp $ */
  20. /* Prototypes for procedures in gsutil.c */
  21.  
  22. #ifndef gsutil_INCLUDED
  23. #  define gsutil_INCLUDED
  24.  
  25. /* ------ Unique IDs ------ */
  26.  
  27. /* Generate a block of unique IDs. */
  28. gs_id gs_next_ids(P1(uint count));
  29.  
  30. /* ------ Memory utilities ------ */
  31.  
  32. /* Transpose an 8 x 8 block of bits. */
  33. /* line_size is the raster of the input data; */
  34. /* dist is the distance between output bytes. */
  35. /* Dot matrix printers need this. */
  36. /* Note that with a negative dist value, */
  37. /* this will rotate an 8 x 8 block 90 degrees counter-clockwise. */
  38. void memflip8x8(P4(const byte * inp, int line_size, byte * outp, int dist));
  39.  
  40. /* Get an unsigned, big-endian 32-bit value. */
  41. ulong get_u32_msb(P1(const byte *p));
  42.  
  43. /* ------ String utilities ------ */
  44.  
  45. /* Compare two strings, returning -1 if the first is less, */
  46. /* 0 if they are equal, and 1 if first is greater. */
  47. /* We can't use memcmp, because we always use unsigned characters. */
  48. int bytes_compare(P4(const byte * str1, uint len1,
  49.              const byte * str2, uint len2));
  50.  
  51. /* Test whether a string matches a pattern with wildcards. */
  52. /* If psmp == NULL, use standard parameters: '*' = any substring, */
  53. /* '?' = any character, '\\' quotes next character, don't ignore case. */
  54. typedef struct string_match_params_s {
  55.     int any_substring;        /* '*' */
  56.     int any_char;        /* '?' */
  57.     int quote_next;        /* '\\' */
  58.     bool ignore_case;
  59. } string_match_params;
  60. extern const string_match_params string_match_params_default;
  61. bool string_match(P5(const byte * str, uint len,
  62.              const byte * pstr, uint plen,
  63.              const string_match_params * psmp));
  64.  
  65. #endif /* gsutil_INCLUDED */
  66.